<{extends file="<{$tempdir}>/public/wxsite.html"}>
<{block name=extendcss}>
<link rel="stylesheet"  href="<{$siteurl}>/templates/<{$tempdir}>/public/wxsite/css/gift.css">
<{/block}>
<{block name=extendjs}>
<script src="<{$siteurl}>/templates/<{$tempdir}>/public/wxsite/js/template.min.js"></script>
<{/block}>
<{block name=myScrolljs}>
<script>
 var myScroll;
 function loaded() {
  myScroll = new iScroll('wrapper', {
   useTransform: false,
   onBeforeScrollStart: function (e) {
    var target = e.target;
    while (target.nodeType != 1) target = target.parentNode;

    if (target.tagName != 'SELECT' && target.tagName != 'INPUT' && target.tagName != 'TEXTAREA')
     e.preventDefault();
   }
  });
 }
 document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
 document.addEventListener('DOMContentLoaded', function () { setTimeout(loaded, 200); }, false);
</script>
<{/block}>
<{block name=hearnav}>
<div class="toptitCon">
 <div class="toptitBox">
  <div class="toptitL"><i></i></div>
  <div class="toptitC"><h3>积分兑换详情</h3></div>
 </div>
</div>
<{/block}>
<{block name=sitetitle}><{$sitename}><{/block}>
<{block name=blockcontent}>
<div id="wrapper" style="top:40px;">
 <div id="scroller">


  <!------------------------积分兑换详情------------------------>
  <!--------兑换图片-------->

  <div class="poiExcTopImg">
   <img src="<{$list['img']|default:$sitelogo}>">
   <p><{$list['title']}></p>
  </div>
  <!--------兑换信息-------->
  <div class="poiExcInfoCon">
   <div class="poiExcInfo"><i class="icon-qianbi"></i><span><{$list['score']}></span></div>
<{if $member['score'] >= $list['score']}>
   <input type="button" value="立即兑换" class="poiExcInp" onclick="duihuan(<{$list['id']}>,<{$list['score']}>,<{$list['stock']}>);"/>
<{else}>
   <input type="button" value="积分不足" />
<{/if}>
  </div>
  <!--------兑换说明-------->
  <div class="poiExcExpCon">
   <div class="poiExcExp">
    <h3>商品简介</h3>
    <!--<p>情侣保温杯不锈钢礼品杯男女士水杯情侣保温杯不锈钢礼品杯男女士水杯。</p>-->
   </div>
   <div class="poiExcSpe">
<{$list['content']}>
    <!--<ul>-->
     <!--<li>名称：六角剑花果斗</li>-->
     <!--<li>材质：水晶玻璃</li>-->
     <!--<li>颜色：透明</li>-->
     <!--<li>净重：1300g</li>-->
    <!--</ul>-->
   </div>
   <!--<div class="poiExctiIn">-->
    <!--<h3>INFORMATION / 产品信息</h3>-->
   <!--</div>-->
   <!--<div class="poiExctiInImg">-->
    <!--<img src="images/012.png" />-->
   <!--</div>-->
  </div>




  <div style="height:10px;"></div>
 </div>
</div>

<script>
 function duihuan(gid,gscore,gstock)
 {

  var cc = "<{$member['uid']}>";
  var userscore = "<{$member['score']}>";
  if( cc < 1)
  {
   Tmsg('登录后才可兑换');
  }else{
   if(userscore < gscore){
    Tmsg('积分不足！');
   }else{
    if(gstock < 1){
     Tmsg('兑换商品库存不足');
    }else{
     window.location.href=  siteurl+'/index.php?ctrl=wxsite&action=dhgift&giftid='+gid ;
    }
   }

  }
 }

</script>

<{/block}>